<template>
    <div>

  
  <div class="nav-hezi">
    <ul>
            <li @click="back">
                <span class="iconfont icon-changyongicon-"></span>
               </li>
            <li>发表评价</li>
        </ul>
    </div>
    <div class="pingjia">
        <img src="../assets/images/拼多多评价_03.png">
        <span>22个好友已买，跟买得红包</span>
        <img src="../assets/images/拼多多评价_06.png" class="dinwei">
    </div>
    <div class="speak1">
        <div class="speak2">
            <ul>
                <li>猜你想说</li>
                <li>物美价廉</li>
                <li>口感丝滑</li>
                <li>物流快速</li>
            </ul>

        </div>
        <div class="speak3">
            <textarea cols="20" rows="5" placeholder="描述商品和使用感受,更受欢迎哦
" v-model="txt"></textarea>
        </div>
        <div class="speak4" @click="tijiao">
            <span>提交评价</span>
        </div>

    </div>
    <div class="zhaopian">
        <div class="xinxin">
            <img src="../assets/images/淘宝评价_03_06.png" >
            <span class="yuyan">评价此单,可以免费领取奖励</span>
          
        </div>
        <div class="baobao">
             <van-checkbox v-model="checked" checked-color="orange" icon-size="18px"></van-checkbox>
             <span id="hz">公开头像昵称,大家可以看到我的主页</span>

        </div>
         
    </div>
</div>
</template>

<script>
import Vue from 'vue';
import { Checkbox, CheckboxGroup } from 'vant';

Vue.use(Checkbox);
Vue.use(CheckboxGroup);
import { Toast } from 'vant';
import axios from "axios";
export default {
  name: 'Ping',
   
    data(){
        return{
            txt:'',
            checked: true,
            
        }
    },
    methods:{
        tijiao(){

    axios({
        method: 'post',
        url:"/api/comment/addComment",
        data:{
            gid:14,
            uid:8,
            comment:this.txt
        }
     })
    .then(res=>{
         console.log(res,'res');
       if(res.data.code=='1'){
           Toast.success('评论成功!');
           console.log(this.txt);
           this.txt = ''
       }else{
           Toast.fail('评论失败!');
       }
        })
   },
   back(){
         this.$router.push('/Master');
   }
 }
   
}
</script>

<style scoped>
@import url(../assets/font_2733385_0fm5xskzw34c/iconfont.css);
@import url(../assets/rest.css);
textarea{
    text-indent: 0.3rem;
}
.baobao{
     margin-left: 0.2rem;
     margin-top: 0.1rem;
}

.nav-hezi{
    width: 100%;
    height: 0.4rem;
    background-color:white;
    position: fixed;
    top: 0;
    z-index: 99;
}
.nav-hezi ul{
    width: 1.3rem;
    height: 100%;
    display: flex;
}
.nav-hezi ul li{
    width: 1rem;
    height: 0.4;
    text-align: center;
    line-height: 0.4rem;
    font-weight: bold;
}
.icon-changyongicon-{
    font-size: 0.2rem;
    font-weight: bold;
}
.pingjia{
    width: 100%;
    height: 0.37rem;
    background-color: white;
    margin-top: 0.5rem;
    line-height: 0.37rem;
    overflow: hidden;
    position: relative;
}
.pingjia img{
    display: inline;
    margin-top: 0.05rem;
    margin-right: 0.1rem;
    position: absolute;
    top: 0;
    left: 0.2rem;
}
.pingjia span{
    margin-right: 0.1rem;
    margin-left: 0.7rem;
   
}
.pingjia .dinwei{
    position: absolute;
     top: 0.05rem;
    left: 2.8rem;
}
.speak1{
    width: 100%;
    height: 3rem;
    overflow: hidden;
}
.speak2{
    width: 100%;
    height: 0.53rem;
    margin-top: 0.1rem;
    display: flex;
    line-height: 0.53rem;
}
.speak2 li{
    width: 0.76rem;
    height: 0.28rem;
    border-radius: 0.3rem;
    border:0.01rem solid gray;
    line-height: 0.28rem;
    margin: auto;
    text-align: center;
 
}
.speak2 ul{
     width: 100%;
    height: 0.53rem;
    display: flex;
}
.speak3{
    width: 100%;
    height: 1.35rem;

}
textarea{
    width: 100%;
    height: 100%;
   outline: none;
   border: none;
}
.speak4{
    width: 3.54rem;
    height: 0.5rem;
    background-color: #3e468f;
    margin: auto;
    margin-top: 0.2rem;
    border-radius: 0.1rem;
    text-align: center;
}
.speak4 span{
    margin: auto;
    text-align: center;
    line-height: 0.5rem;
    font-size: 0.2rem;
    color: white;
}
.zhaopian{
    width: 3.5rem;
    height: 0.75rem;
 
    margin: auto;
    position: relative;
    
}
.zhaopian img{
    width: 3.7rem;
    height: 1rem;
    display: inline-block;
    margin-top: 0.1rem;
    margin-left: 0.1rem;
}
.xinxin{
    width: 3.3rem;
    height: 0.33rem;
    background-color: #fef5f0;
    margin: auto;
    line-height: 0.33rem;
    display: flex;
}
.xinxin img{
    width: 0.13rem;
    height: 0.13rem;
    background-color:yellow ;
    margin-right: 0.2rem;
}
.yuyan{
    color: #f36a3d;
}
#hz{
    font-size: 0.14rem;
    display: inline-block;
    margin-top: 0.1rem;
    position: absolute;
    bottom: 0.15rem;
    left: 0.5rem;
}
</style>